import { Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";

@Index("device_id", ["deviceId"], {})
@Index("user_id", ["userId"], {})
@Entity("clean_record", { schema: "bacsense_water" })
export class CleanRecord {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", { name: "user_id", unsigned: true, default: () => "'0'" })
  userId: number;

  @Column("int", { name: "device_id", unsigned: true, default: () => "'0'" })
  deviceId: number;

  @Column("tinyint", {
    name: "status",
    comment: "0：等待开启，1：检测中，2：检测失败",
    unsigned: true,
    default: () => "'0'",
  })
  status: number;

  @Column("tinyint", {
    name: "err",
    comment: "",
    unsigned: true,
    default: () => "'0'",
  })
  err: number;

  @Column("int", {
    name: "create_time",
    comment: "创建时间",
    unsigned: true,
    default: () => "'0'",
  })
  createTime: number;
}
